﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="listsupply.aspx.cs" Inherits="lcs.Web.Admin.TimeLine.listsupply" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>计划</title>
    <style type="text/css">
        .style1 {
            width: 100%;
        }
    </style>    
    <script src="../../Scripts/JsTools.js"></script>
    <link href="../../css/myStyle.css" rel="stylesheet" />   
    
    <script src="../../Scripts/jquery-1.4.1.min.js"></script>
     <link href="../../Style.css" rel="stylesheet" />
    <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#txt_projectName").autocomplete({
                minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                source: function (request, response) {
                    $.ajax({
                        type: "POST",          // 通过request.term可以获得文本框内容   
                        url: "../../Handler.ashx?keyword=" + request.term,
                        contentType: "application/json; charset=gb2312",
                        dataType: "json",
                        success: function (data) {
                            // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                            //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                            response($.map(data, function (item) {
                                return { label: item.projectName + item.proid, value: item.projectName };
                            }));
                        },
                        error: function () {
                            alert("ajax请求失败");
                        }
                    });
                }
            });
        });
    </script>
</head>
<body>
    
    <form id="form1" runat="server">
        <table cellpadding="0" cellspacing="0" class="style1">
            <tr>
                <td style="height: 15px;">项目名称：<asp:TextBox ID="txt_projectName" runat="server"></asp:TextBox>
                    &nbsp; 物料描述：<asp:TextBox ID="txt_material" runat="server"></asp:TextBox>
                    &nbsp;供货商：<asp:TextBox ID="txt_supplier" runat="server"></asp:TextBox>
                    &nbsp;</td>
            </tr>
            
            <tr>
                <td style="height: 15px;">&nbsp;</td>
            </tr>
            
            <tr>
                <td style="height: 15px;">采购订单号：<asp:TextBox ID="txt_purchaseid" runat="server"></asp:TextBox>
                    &nbsp;项目编号：<asp:TextBox ID="txt_proid" runat="server"></asp:TextBox>
&nbsp; <asp:Button ID="btn_sel" runat="server" CssClass="btn" OnClick="btn_sel_Click"
                        Text="查询" /></td>
            </tr>
            
            <tr>
                <td style="height: 15px;">
                    <asp:Label ID="lbl_dsCount" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="height: 15px; text-align: center;">
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                        BorderWidth="0px" CellPadding="0" CellSpacing="1" CssClass="gv" GridLines="None"
                        OnRowCommand="GridView1_RowCommand" 
                        OnRowDataBound="GridView1_RowDataBound" PageSize="30" Width="100%">
                        <Columns>
                            <asp:HyperLinkField DataNavigateUrlFields="supplyPlanId" DataNavigateUrlFormatString="indexsupply.aspx?sid={0}" Text="查看状态" />
                            <asp:BoundField DataField="sname" HeaderText="供应商" />
                            <asp:TemplateField HeaderText="项目名称">                            
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Decode(Eval("projectname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                            <asp:BoundField DataField="proid" HeaderText="项目编号" />
                            <asp:BoundField DataField="material" HeaderText="物料描述" />
                            <asp:BoundField DataField="supplyDate" DataFormatString="{0:d}"
                                HeaderText="供货期" />
                            
                            <asp:BoundField DataField="usework" HeaderText="需用单位" />
                            <asp:BoundField DataField="winBid" HeaderText="中标批次" Visible="False" />
                            <asp:BoundField DataField="purchaseid" HeaderText="采购订单号" />
                            
                            <asp:BoundField DataField="slink" HeaderText="供应商联系电话" />
                        </Columns>
                        <PagerStyle CssClass="mypager" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td style="height: 15px; text-align: left;">

                    <webdiyer:AspNetPager ID="AspNetPager1" runat="server" AlwaysShow="True" CurrentPageButtonPosition="Center"
                        PageSize="20" AlwaysShowFirstLastPageNumber="True" CustomInfoTextAlign="Left"
                        FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" NumericButtonCount="10"
                        PrevPageText="上一页" CssClass="paginator" CurrentPageButtonClass="" CustomInfoHTML="第 %CurrentPageIndex% 页|共 %PageCount% 页,%RecordCount%条记录 "
                        LayoutType="Table" ShowCustomInfoSection="Left" ShowNavigationToolTip="True"
                        ShowPageIndexBox="Always" PageIndexBoxType="DropDownList" TextAfterPageIndexBox="页"
                        TextBeforePageIndexBox="转到第" OnPageChanged="AspNetPager1_PageChanged">
                    </webdiyer:AspNetPager>



                </td>
            </tr>
            </table>
    </form>
</body>
</html>
